import 'package:bxultimate/app/theme/app_theme.dart';
import 'package:bxultimate/widgets/mk_page.dart';
import 'package:flutter/material.dart';
import 'package:flutter_widget_from_html/flutter_widget_from_html.dart';
import 'package:get/get.dart';
import 'package:tdesign_flutter/tdesign_flutter.dart';

import 'controller.dart';

class SystemSettingUserAgreementPage extends StatefulWidget {
  const SystemSettingUserAgreementPage({Key? key}) : super(key: key);

  @override
  State<SystemSettingUserAgreementPage> createState() =>
      _SystemSettingUserAgreementPageState();
}

class _SystemSettingUserAgreementPageState
    extends State<SystemSettingUserAgreementPage> {
  final controller = Get.find<SystemSettingUserAgreementController>();
  final state = Get.find<SystemSettingUserAgreementController>().state;

  @override
  Widget build(BuildContext context) {
    return MkPage(
        child: Scaffold(
            backgroundColor: Colors.transparent,
            appBar: TDNavBar(
              title: '用户协议',
              backgroundColor: Colors.transparent,
            ),
            body: ListView(
              children: [
                Padding(
                    padding: EdgeInsets.all(AppTheme.iDefaultPadding),
                    child: Obx(() => HtmlWidget(state.content)))
              ],
            )));
  }

  @override
  void dispose() {
    Get.delete<SystemSettingUserAgreementController>();
    super.dispose();
  }
}
